package com.tuanzi.loan.web.lazy.compensation;

import com.tuanzi.loan.business.service.compensation.CompensationCompanyInfoService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.compensation.CompensationCompanyInfoRequest;
import com.tuanzi.loan.vo.response.compensation.CompensationCompanyInfoResponse;
import org.springframework.data.domain.Page;

/**
 * @author caiwanlin
 * @create 2019-02-12 14:26
 */
public class CompensationCompanyInfoLazyDataModel extends
        BaseLazyDataModel<CompensationCompanyInfoRequest,CompensationCompanyInfoResponse> {
    private CompensationCompanyInfoService compensationCompanyInfoService = SpringContextHolder.getBean(CompensationCompanyInfoService.class);
    public CompensationCompanyInfoLazyDataModel(CompensationCompanyInfoRequest compensationCompanyInfoRequest) {
        super(compensationCompanyInfoRequest);
    }

    @Override
    protected Page<CompensationCompanyInfoResponse> doLoad(PageSearcher<CompensationCompanyInfoRequest> pageSearcher) {
        return compensationCompanyInfoService.list(pageSearcher);
    }
}
